{% extends "base.html" %}

{% block title %}{{ title }} - 滩羊疫病监测系统{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-body">
                    <h2 class="card-title mb-4">{{ title }}</h2>
                    <form method="POST">
                        {{ form.hidden_tag() }}
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                {{ form.name.label(class="form-label") }}
                                {{ form.name(class="form-control") }}
                                {% if form.name.errors %}
                                    {% for error in form.name.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="col-md-6 mb-3">
                                {{ form.type.label(class="form-label") }}
                                {{ form.type(class="form-select") }}
                                {% if form.type.errors %}
                                    {% for error in form.type.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                {{ form.isolation_date.label(class="form-label") }}
                                {{ form.isolation_date(class="form-control", type="date") }}
                                {% if form.isolation_date.errors %}
                                    {% for error in form.isolation_date.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="col-md-6 mb-3">
                                {{ form.isolation_location.label(class="form-label") }}
                                {{ form.isolation_location(class="form-control") }}
                                {% if form.isolation_location.errors %}
                                    {% for error in form.isolation_location.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                {{ form.latitude.label(class="form-label") }}
                                {{ form.latitude(class="form-control") }}
                                {% if form.latitude.errors %}
                                    {% for error in form.latitude.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                            <div class="col-md-6 mb-3">
                                {{ form.longitude.label(class="form-label") }}
                                {{ form.longitude(class="form-control") }}
                                {% if form.longitude.errors %}
                                    {% for error in form.longitude.errors %}
                                        <div class="invalid-feedback d-block">{{ error }}</div>
                                    {% endfor %}
                                {% endif %}
                            </div>
                        </div>
                        <div class="mb-3">
                            {{ form.gene_sequence.label(class="form-label") }}
                            {{ form.gene_sequence(class="form-control", rows="5") }}
                            {% if form.gene_sequence.errors %}
                                {% for error in form.gene_sequence.errors %}
                                    <div class="invalid-feedback d-block">{{ error }}</div>
                                {% endfor %}
                            {% endif %}
                        </div>
                        <div class="d-grid gap-2">
                            {{ form.submit(class="btn btn-primary") }}
                            <a href="{{ url_for('pathogen.list') }}" class="btn btn-outline-secondary">返回列表</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 